package cn.yqn.exception;

import cn.yqn.enums.GlobalEnumCode;
import lombok.Getter;

/**
* @Title: 自定义异常类
* @Description: TODO
* @Author: YQN
* @Version: 1.0
* @Date:  2022/8/26 11:26
* @Parameters:
* @Return
*/
@Getter
public class GlobalCustomException extends RuntimeException {

    private String errorMessage;

    private String errorCode;

    public GlobalCustomException() {
        super();
    }

    public GlobalCustomException(String Message) {
        super(Message);
    }

    public GlobalCustomException(String errorMessage, String errorCode) {
        super(errorMessage);
        this.errorMessage = errorMessage;
        this.errorCode = errorCode;

    }
    public GlobalCustomException(GlobalEnumCode globalEnumCode) {
        super(globalEnumCode.getMessage());
        this.errorMessage = globalEnumCode.getMessage();
        this.errorCode = globalEnumCode.getCode();
    }
}
